package com.yanqu.road.dao.dbV2.serializer;

import java.lang.reflect.Field;

public class DInt extends Serializer<Integer>{
    @Override
    public Integer deserialize(Object object, Field field) {
        if (object instanceof Integer) {
            return (Integer) object;
        }
        return this.defaultValue();
    }

    @Override
    public Object serialize(Integer integer) {
        return integer;
    }

    @Override
    public String SqlType() {
        return "INT(11)";
    }

    @Override
    public Integer defaultValue() {
        return 0;
    }
}
